package com.ruoyi.mstore.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.mstore.domain.OrderServiceItem;
import com.ruoyi.mstore.service.OrderServiceItemService;
import com.ruoyi.mstore.mapper.OrderServiceItemMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author mder
* @description 针对表【order_service_item(服务项目订单关联表)】的数据库操作Service实现
* @createDate 2025-03-19 17:30:33
*/
@Service
public class OrderServiceItemServiceImpl extends ServiceImpl<OrderServiceItemMapper, OrderServiceItem>
    implements OrderServiceItemService{


    @Override
    public List<OrderServiceItem> getByOrderServiceItem(OrderServiceItem orderServiceItem) {
        LambdaQueryWrapper<OrderServiceItem> queryWrapper = new LambdaQueryWrapper<>();
        // 根据传入的 OrderServiceItem 对象动态构建查询条件
        if (orderServiceItem.getOrderId() != null) {
            queryWrapper.eq(OrderServiceItem::getOrderId, orderServiceItem.getOrderId());
        }
        if (orderServiceItem.getServiceId() != null) {
            queryWrapper.eq(OrderServiceItem::getServiceId, orderServiceItem.getServiceId());
        }
        if (orderServiceItem.getServiceName() != null) {
            queryWrapper.eq(OrderServiceItem::getServiceName, orderServiceItem.getServiceName());
        }
        // 可以根据需要添加更多字段的查询条件
        return baseMapper.selectList(queryWrapper);
    }
}




